import java.util.Scanner;

/**
 * Created by dllo on 3/29/18.
 */
public class Test05 {

    // 水仙花数
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("输入一个3位数");

        int num = scanner.nextInt();

        int rawnum = num;

        int hundreds = num / 100;
        num %= 100;
        int tens = num / 10;
        num %= 10;

        if (rawnum == hundreds * hundreds * hundreds
                + tens * tens * tens
                + num * num * num) {
            System.out.println("是水仙花数");
        } else {
            System.out.println("不是水仙花数");
        }
    }
}
